import React, {Component} from "react";
import Item from "../Item";


export default class List extends Component{
    render(){
        const {todos, onChange, deleteItem} = this.props
        return(
            <ul className="todo-main">
                {
                    todos.map(w => {
                        return <Item key={w.id} {...w} onChange={onChange} deleteItem={deleteItem}/>
                    })
                }
            </ul>
        )
    }
}